﻿using System;
using System.Net;

class vivo
{
    public string Name;
    public string Color;
    private int gas = 25;
    private int service_interval;
    public Driver Driver;

    public int Gas { get => gas; set => gas = value; }
    public int Service_interval { get => service_interval; set => service_interval = value; }

    public vivo(string name, string color, int service_int, Driver driver)
    {
        Name = name;
        Color = color;
        Service_interval = service_int;
        Driver = driver;
    }

    public int calculate_fuel_for_trip(int trip_distance)
    {
        return trip_distance / gas;
    }
    public void PrintCarDetails()
    {
        System.Console.WriteLine("--- Car Details ---");
        System.Console.WriteLine("Car Owner: {0}", Name);
        System.Console.WriteLine("Car Color: {0}", Color);
        System.Console.WriteLine("Gas Mileage: {0} mpg", gas);
        System.Console.WriteLine("Service Interval: {0} miles", Service_interval);
        System.Console.WriteLine("Driver Level: {0} cc", Driver.Level);
        System.Console.WriteLine("Driver Name: {0}", Driver.Name);
    }
}

public class Driver
{
    public int Level;
    public string Name;

    public Driver(int level, string name)
    {
        Level = level;
        Name = name;
    }
}

public class OOP3
{
    public static void Main()
    {
        int s1 = 4000;

        Driver driver = new Driver(3, "yan");

        vivo car = new vivo("wzy", "black", s1, driver);

        vivo car2 = new vivo("fyf", "red", s1, driver);

        car.PrintCarDetails();
        car2.PrintCarDetails();

        driver.Level = 5;

        car.PrintCarDetails();
        car2.PrintCarDetails();

        Driver driver1 = new Driver(8, "niu");
        car2.Driver = driver1;

        car.Service_interval = 4500;

        car.PrintCarDetails();
        car2.PrintCarDetails();


        Console.ReadKey();
    
    }

}